package cn.myzf.fort.access.accesscommon.core.impl;


import cn.myzf.fort.access.accesscommon.event.ProcessOutputEvent;
import cn.myzf.fort.access.accesscommon.processoutput.core.StreamingProcessOutputType;
import cn.myzf.fort.access.accesscommon.processoutput.core.StreamingProcessOwner;
import cn.myzf.fort.access.accesscommon.utils.SpringUtil;

public class CustomStreamingProcess implements StreamingProcessOwner {

    private String sock5Foward;

    public CustomStreamingProcess(String sock5Foward) {
        super();
        this.sock5Foward = sock5Foward;
    }

    @Override
    public StreamingProcessOutputType getOutputType() {
        return StreamingProcessOutputType.BOTH;
    }



    @Override
    public void processOutput(String line) {
        //发送输出事件
        SpringUtil.getApplicationContext().publishEvent(new ProcessOutputEvent(this,sock5Foward,line));
    }
}
